package com.ice.work.moment.crawler.dao.position.type;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ice.work.moment.facade.crawler.model.PositionType;
import org.springframework.stereotype.Repository;

/**
 * @Description Comment dao
 * @Author DELL
 * @Create 2019-01-10
 * @Since 1.0.0
 */
@Repository
public class PositionTypeRepository extends ServiceImpl<IPositionTypeMapper, PositionType> implements IPositionTypeRepository {


    @Override
    public PositionType findByValueAndDataStatus(PositionType institutionalPositionType) {
        return this.baseMapper.selectOne(new QueryWrapper<PositionType>().lambda().eq(PositionType::getValue, institutionalPositionType.getValue()).eq(PositionType::getDataStatus, institutionalPositionType.getDataStatus()));
    }

    @Override
    public PositionType findByValueAndDataStatus(String value, Integer dataStatus) {
        return this.baseMapper.selectOne(new QueryWrapper<PositionType>().lambda().eq(PositionType::getValue, value).eq(PositionType::getDataStatus, dataStatus));

    }
}


